home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / bc_pas_1.zip / RECFILA.ASM < prev    next >
Assembly Source File  |  1992-12-08  |  5KB  |  200 lines

  1. ;$Author:   DCODY  $
  2. ;$Date:   08 Dec 1992 16:41:56  $
  3. ;$Header:   X:/sccs/pcmapps/recfila.asv   1.4   08 Dec 1992 16:41:56   DCODY  $
  4. ;$Log:   X:/sccs/pcmapps/recfila.asv  $
  5. ;  
  6. ;     Rev 1.4   08 Dec 1992 16:41:56   DCODY
  7. ;  moved externADDR macro for Borland linker
  8. ;  
  9. ;     Rev 1.3   13 Nov 1992 18:31:18   DCODY
  10. ;  added code to make sure the active mixer (input vs output) was restored
  11. ;  correctly for the left and right side.
  12. ;  
  13. ;     Rev 1.2   17 Jul 1992 14:25:40   DCODY
  14. ;  TurnItOn will only execute if TurnItOff was first called.
  15. ;  
  16. ;     Rev 1.1   23 Jun 1992 16:09:22   DCODY
  17. ;  No change.
  18. ;  
  19. ;     Rev 1.0   15 Jun 1992 09:26:46   BCRANE
  20. ;  Initial revision.
  21. ;$Logfile:   X:/sccs/pcmapps/recfila.asv  $
  22. ;$Modtimes$
  23. ;$Revision:   1.4  $
  24. ;$Workfile:   recfila.asm  $ 
  25.  
  26.     Title    recfila.asm  --  Miscellaneous assembler code for recfile.c
  27.         page    64,131
  28.  
  29. ;   /*\
  30. ;---|*|------------====< RECFILA.ASM >====------------
  31. ;---|*|
  32. ;---|*| Copyright (c) 1991, Media Vision, Inc. All rights reserved
  33. ;---|*|
  34. ;   \*/
  35.  
  36.     .xlist
  37.     include model.inc
  38.     include masm.inc
  39.         include common.inc
  40.     include binary.inc
  41.     .list
  42.  
  43. PCMCODEVERSION    equ    0003h        ; version 00.03
  44.  
  45.     externADDR  MVInitMixerCode,FFAR    ; set mixer function call
  46.  
  47.  
  48. ;
  49. ;---------------------------========================---------------------------
  50. ;---------------------------====< DATA SECTION >====---------------------------
  51. ;---------------------------========================---------------------------
  52. ;
  53.         .data
  54. ;
  55. ; Global Data Declarations
  56. ;
  57.     public    RightInputChannel
  58. RightInputChannel    dw    -1    ; PCm right channel
  59. RightInputMixer     db    0
  60.  
  61.         public  LeftInputChannel
  62. LeftInputChannel    dw    -1    ; PCM left channel
  63. LeftInputMixer        db    0
  64.  
  65.     extrn    MVSetMixerFunction:dword    ; set mixer function call
  66.     extrn    MVGetMixerFunction:dword    ; get mixer function call
  67.  
  68. ;
  69. ;---------------------------========================---------------------------
  70. ;---------------------------====< CODE SECTION >====---------------------------
  71. ;---------------------------========================---------------------------
  72. ;
  73.         .code
  74.     assume ds:@data
  75.  
  76. ;   /*\
  77. ;---|*|
  78. ;---|*|------------====< TurnItOff >====----------------
  79. ;---|*|
  80. ;---|*| Turn off the PCM Input Mixer channels. This avoids feedback.
  81. ;---|*|
  82. ;---|*| Entry Conditions:
  83. ;---|*|     None
  84. ;---|*|
  85. ;---|*| Exit Conditions:
  86. ;---|*|     None
  87. ;---|*|
  88. ;   \*/
  89.  
  90.     public    TurnItOff
  91. TurnItOff    proc
  92.     push    bp
  93.     mov    bp,sp
  94. ;
  95. ; initialize the mixer code.
  96. ;
  97.     sub    ax,ax            ; send a zero path
  98.     push    ax
  99.   if @datasize
  100.         push    ax
  101.   endif
  102.     call    MVInitMixercode
  103.     mov    sp,bp
  104. ;
  105. ; Save each setting, then turn off the PCM channels to kill feed back
  106. ;
  107.     mov    cx,BI_INPUTMIXER    ; get the input mixer setting
  108.     mov    [LeftInputMixer],cl
  109.     mov    dx,BI_L_PCM
  110.     call    dword ptr [MVGetMixerFunction]
  111.         mov     LeftInputChannel,bx
  112.  
  113.         or      bh,bh                   ; is this the active channel?
  114.     jnz    @F            ; yes, continue on...
  115.  
  116.     mov    cx,BI_OUTPUTMIXER    ; get the output mixer setting
  117.     mov    [LeftInputMixer],cl
  118.     mov    dx,BI_L_PCM
  119.     call    dword ptr [MVGetMixerFunction]
  120.         mov     LeftInputChannel,bx
  121. ;
  122. @@:
  123.     mov    cx,BI_INPUTMIXER    ; get the input mixer setting
  124.         mov     [RightInputMixer],cl
  125.     mov    dx,BI_R_PCM
  126.     call    dword ptr [MVGetMixerFunction]
  127.     mov    RightInputChannel,bx
  128.  
  129.     or    bh,bh            ; is this the active channel?
  130.     jnz    @F            ; yes, continue on...
  131.  
  132.     mov    cx,BI_OUTPUTMIXER    ; get the output mixer setting
  133.         mov     [RightInputMixer],cl
  134.     mov    dx,BI_R_PCM
  135.     call    dword ptr [MVGetMixerFunction]
  136.     mov    RightInputChannel,bx
  137. ;
  138. @@:
  139.     mov    cl,[RightInputMixer]
  140.     sub    bx,bx
  141.     call    dword ptr [MVSetMixerFunction]
  142.  
  143.     mov    cl,[LeftInputMixer]
  144.     mov    dx,BI_L_PCM
  145.     call    dword ptr [MVSetMixerFunction]
  146.  
  147.     pop    bp
  148.     ret
  149.  
  150. TurnItOff    endp
  151.  
  152. ;
  153. ;   /*\
  154. ;---|*|------------====< TurnItOn() >====------------
  155. ;---|*|
  156. ;---|*| Restore the mixer settings for the PCM left/right channels
  157. ;---|*|
  158. ;---|*| Entry Conditions:
  159. ;---|*|     None
  160. ;---|*|
  161. ;---|*| Exit Conditions:
  162. ;---|*|     None
  163. ;---|*|
  164. ;   \*/
  165.  
  166.         public  TurnItOn
  167. TurnItOn        proc
  168. ;
  169. ; if we didn't set the channels, then don't restore them!
  170. ;
  171.     cmp    [RightInputChannel],-1    ; did we touch these?
  172.     jz    tuion05         ; no, just exit...
  173. ;
  174. ; restore each mixer setting                                           */
  175. ;
  176.         mov     cl,[LeftInputMixer]
  177.     mov    dx,BI_L_PCM
  178.     mov    bx,LeftInputChannel
  179.     inc    bx
  180.     call    dword ptr [MVSetMixerFunction]
  181.  
  182.         mov     cl,[RightInputMixer]
  183.     mov    dx,BI_R_PCM
  184.     mov    bx,RightInputChannel
  185.     inc    bx
  186.     call    dword ptr [MVSetMixerFunction]
  187. ;
  188. tuion05:
  189.     ret
  190.  
  191. TurnItOn    endp
  192.  
  193.  
  194. ;   /*\
  195. ;---|*| end of RECFILA.ASM
  196. ;   \*/
  197.  
  198.         end
  199.  
  200.